package com.ct.boot.launch.Aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @Auther: Charles chen
 * @Date: 2020/7/5 10:01
 * @Description:
 */
@Aspect
@Component
public class AspectConfig {
@Pointcut("execution(* com.ct.boot.launch.controller.*.*(..))")
    public void pointcut(){

}
@Around("pointcut()")
    public Object around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
    System.out.println("切入");
    long start =System.currentTimeMillis();
    Object proceed = proceedingJoinPoint.proceed();
    System.out.println("切出");
    long end=System.currentTimeMillis();
    System.out.println("消耗时间"+(end-start));
    return proceed;
}
}
